﻿/**********************************************************************
 * @file   ToolBarBase.h
 * @brief  工具条基类
 * @author BaGuijun (baguijun@163.com)
 * @date   2024-09-10
 *********************************************************************/
#ifndef _ToolBarBase_H
#define _ToolBarBase_H

#include "CFDPostUIComponents_global.h"
#include <QToolBar>
#include <QComboBox>

class SARibbonPannel;

namespace GUI {
    class MainWindow;
}

namespace Interface {
    class FITKCFDPost3DManager;
    class PostGraphObjectManager;
    class FITKAbstractCFDPostData;
    class PostGraphObjectBase;
}

namespace GUI {
    class CFDPOSTUICOMPONENTS_EXPORT ToolBarBase : public QToolBar {
        Q_OBJECT;
      public:
        ToolBarBase(SARibbonPannel* pannel = nullptr);
        ~ToolBarBase();
        virtual void updateCurrentGraphObj(int objID) = 0;
      protected:
        QAction* createAction(QString actionName, QString iconPath = "", QString actionTitle = "");
        QAction* createAction(QString iconText,QString actionName, QString iconPath, QString toolTip);
        void reRender();
        void addAction(QAction* action);
        void addAction(QWidget* widget);
        void setEnabled(bool);
      private slots:
        void on_actionClicked();
      protected:
        /**
         * @brief  后处理数据管理器
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-09-06
         */
        Interface::FITKCFDPost3DManager* _postDataManager = nullptr;

        Interface::PostGraphObjectManager* _postGraphManager = nullptr;
        /**
         * @brief  后处理数据对象
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-09-13
         */
        int _currentDataID = -1;

        // window
        MainWindow* m_pMainWindow = nullptr;
        // 菜单栏pannel
        SARibbonPannel* m_pPannel = nullptr;
        // action容器
        QVector<QAction*> m_vActionList;
    };
}
#endif
